package indi.zhifa.study2025.oa.admin.controller;

import indi.zhifa.engine.core.common.web.ann.ZhiFaRestController;
import indi.zhifa.study2025.oa.admin.facade.dep.IPositionTagFacade;
import indi.zhifa.study2025.oa.common.util.ConstantUtil;
import indi.zhifa.study2025.oa.model.expose.dep.dto.PositionCreateDto;
import indi.zhifa.study2025.oa.model.expose.dep.dto.PositionEditDto;
import indi.zhifa.study2025.oa.model.expose.dep.dto.PositionTagCreateDto;
import indi.zhifa.study2025.oa.model.expose.dep.dto.PositionTagEditDto;
import indi.zhifa.study2025.oa.model.expose.dep.vo.PositionTagVo;
import indi.zhifa.study2025.oa.service.dep.IPositionTagService;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Slf4j
@Validated
@RequiredArgsConstructor
@Tag(name = "职位Tag接口")
@ZhiFaRestController
@RequestMapping(ConstantUtil.API_PREFIX + "/positionTagMgr")
public class PositionTagController {

    final IPositionTagFacade mPositionTagFacade;

    @PostMapping
    public PositionTagVo create(@RequestBody PositionTagCreateDto pPositionTagCreateDto){
        return mPositionTagFacade.create(pPositionTagCreateDto);
    }

    @PostMapping("/{id}")
    public PositionTagVo edit(@PathVariable("id") Long pId, @RequestBody PositionTagEditDto pPositionTagEditDto){
        return mPositionTagFacade.edit(pId, pPositionTagEditDto);
    }

    @DeleteMapping("/{id}")
    public PositionTagVo delete(@PathVariable("id") Long pId){
        return mPositionTagFacade.delete(pId);
    }

    @GetMapping("/{id}")
    public PositionTagVo info(@PathVariable("id") Long pId){
        return mPositionTagFacade.info(pId);
    }

    @GetMapping("/list")
    public List<PositionTagVo> list(){
        return mPositionTagFacade.list();
    }


}
